﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using ImpExpData.Core;
using ImpExpData.Interface;

namespace ImpExpData.Presenter
{
    public class ExportPresenter
    {
        private IExportForm _view;
        
        public ExportPresenter(IExportForm view)
        {
            _view = view;
            _view.GoExportData += GoExportData;
        }

        public void GoExportData (object sender, EventArgs e)
        {
            //List<ExportData> exportsData = new List<ExportData>();
            //if (_view.IsVisits)
            //{
            //    ExportData exportData = new ExportData();
            //    exportData.FileName = DateTime.Now.ToString("ddmmyy") + "Visits.xml";
            //    exportData.TableName = "Visits";
            //    exportsData.Add(new ExportData());
            //}
            //if (_view.IsOrders)
            //{
            //    ExportData exportData = new ExportData();
            //    exportData.FileName = DateTime.Now.ToString("ddmmyy") + "Orders.xml";
            //    exportData.TableName = "Orders";
            //    exportsData.Add(new ExportData());
            //}
            //foreach (var exportData in exportsData)
            //{
            //    exportData.Export();
            //}
        }
    }
}
